package com.roin.learn.freemarker.service.impl;

import com.roin.learn.freemarker.dao.BookMapper;
import com.roin.learn.freemarker.entity.Book;
import com.roin.learn.freemarker.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BookServiceImpl implements BookService{
    @Autowired
    BookMapper bookMapper;
    public List<Book> getAll(){
        return bookMapper.selectByExample(null);
    }
    public Book getById(Integer id){
        return bookMapper.selectByPrimaryKey(id);
    }
}
